1. Field of the Invention
This invention relates to a computer graphics method, and particularly to a rendering method for rendering an arrow object to a 3-dimensional visual effect.
2. Description of the Related Art
In the prior art, a 3-dimensional image processing effect on an object, i.e. a solid effect, is typically achieved by a polygonal approach. The polygonal approach can be summarized by the following steps: determine a certain shape 2-dimensional picture, cut the picture into a plurality of polygons using a computer, then change pixel color values in each polygon by interpolation, thereby achieving a solid effect. However, because the shape of a 2-dimensional picture is formed with continuous curve, the operation of display a 2-D graph as a 3-D graph is performed by a high-order polynomial equations and an approach method. This requires the use of complicated computation and results in a rough visual effect. Alternatively, if a 3-dimensional object is directly processed for a 3-dimensional image display, a great amount of computation is required and the resulting display can be rough in quality.
Further, the conventional 3-dimensional process has difficulty dealing with specifically 3-dimensional visual effect, for example, rendering a 2D arrow object graphical display from 3-dimensional arrow object image data stored in memory. An arrow object has an arrowhead and a line. Typically, the line portion of an arrow object is rendered using a real 3D pipe object. Because the image data converted from the 3D pipe object is stored in the 3D form but the image data on display is need in the 2D form, further processes using the stored 3D image data are complicated. For example, it is difficult to combine a 3D pipe object with a 3D arrowhead object to form a 3D arrow object graph due to the connection of anti-aliasing boundaries from the 3D-to-2D conversion data.
A processing method for rendering a 3-dimensional image effect based on a 2-dimensional image object has been disclosed in U.S. Pat. No. 5,828,380. This processing method finds the corresponding relation mapping function of each pixel of a picture to obtain a pixel vector mapping relation corresponding to a 2-dimensional image object. The pixel vector mapping relation is further used to create an image effect on relation map, thereby creating the 3-dimensional effect. For example, by creating the corresponding length of the third axis (i.e. z-axis), a substantially solid effect is achieved.
FIG. 1 is a schematic diagram illustrating a mapping function relative to a certain picture in the prior art. As shown in FIG. 1, a 2-dimensional picture object is a circular area between an outer ring 40 and an internal ring 41. The 2-dimensional picture object, i.e., the circular area, comprises multiple pixels (in a grid arrangement), for example, A1, A2, and A3 in FIG. 1. The corresponding relation mapping function defines a vector to each pixel, the vector representing the relation of the pixel and the closest vector of the picture object edge, for example, V1, V2, V3 of FIG. 1.
The image effect on relation map is the function of performing the 2D to 3-D conversion. A threshold length (hereinafter denoted by r1) is defined in the image effect on relation map to represent a pixel applied to the 2-D to 3-D transform only if the length from the pixel to the edge of the picture object is within the threshold length. Each pixel within the threshold length is determined by a predetermined contour (to describe the z-axis corresponding to each pixel) to present the substantially solid effect.
The image processing method in the U.S. Pat. No. 5,828,380 discloses a simple operation to quickly achieve the 3-D display effect. However, the U.S. Pat. No. 5,828,380 does not teach us how to join two objects for displaying on a screen. More importantly, using the vector in the 2-D picture object, the solid arrow object picture difficult to achieve in the prior art can be easily rendered.
Accordingly, the primary object of the invention is to provide a processing method for rendering a 3-dimensional display. The processing method can utilize a simple operation to quickly achieve a 3-dimensional display. Further, the processing method can add various additional graphical processes, e.g., converting a line into a dashline, into the 3D display.
To realize the above and other objects, the invention provides a processing method for rendering a planar arrow object into a 3-dimensional arrow object, the method comprising the steps as follows: setting a total length of an arrow object, wherein the arrow object includes at least one end having the arrowhead portion; determining the arrowhead portion and the line portion of the arrow object; creating a corresponding first mapping data of the line portion, wherein the first mapping data represents the third axis data associated with the pixels of the line portion; extracting a corresponding arrowhead graphical data of the arrowhead portion; creating a corresponding second mapping data of the graphical data of the arrowhead portion, wherein the second mapping data represents the third axis data corresponding to the pixels of the graphical data of the arrowhead portion; creating the respectively corresponding masks of the line portion and the arrowhead portion; superimposing the arrowhead mask and the line mask so as to create an arrow object mask; and creating a 3-dimensional image of the arrow object according to the first mapping data and the second mapping data and utilizing the arrow object mask.
In a second embodiment, other graphical processes to the arrow object can be included when rendering the solid arrow object. For example, the line portion of the arrow object can be converted into a dashline form. The method of the dashline conversion is proceeded as follows: creating a dashline mask based on the line portion, superimposing the line mask and the arrowhead mask, subtracting the dashline mask from the superimposed mask to create an arrow object, and creating a 3-dimensional image of the arrow object. After the processing, the line portion of the arrow object is present in a dashline form.